package com.wlxk.base.common.util;

import com.wlxk.base.common.constant.WlErrEnum;
import com.wlxk.base.common.exception.WlException;
import com.wlxk.core.tool.WlEmptyUtil;

/**
 * @author wlxk
 * @since 2021-11-03 17:04:07
 */
public class WlPreconditions {

    public static void checkParam(boolean expression, String message) {
        if (!expression) {
            throw new WlException(WlErrEnum.PARAM_ERR.code, message);
        }
    }

    public static void checkNotEmpty(Object obj, String message) {
        checkParam(WlEmptyUtil.isNotEmpty(obj), message);
    }
}